package com.youtills.resource;

import com.youtills.domain.contact.Address;

/**
 * TODO - !!!doc me!!!
 *
 * @author ravi.chiluveru
 * @since 23.0 (8/15/14)
 */
public class CommonAttribute {

    public static final Attribute.IntegerAttribute id = new Attribute.IntegerAttribute("id");
    public static final Attribute.LongAttribute parentResourceType = new Attribute.LongAttribute("parent_resource_type");
    public static final Attribute.LongAttribute parentResourceId = new Attribute.LongAttribute("parent_resource_id");
    public static final Attribute.StringAttribute name = new Attribute.StringAttribute("name");
    public static final Attribute.StringAttribute key = new Attribute.StringAttribute("key").setMysqlColumnName("key1");
    public static final Attribute.StringAttribute description = new Attribute.StringAttribute("description");
    public static final Attribute.DateAttribute created_date = new Attribute.DateAttribute("created_date");
    public static final Attribute.DateAttribute modified_date = new Attribute.DateAttribute("modified_date");


    public static final Attribute.StringAttribute address_1 = new Attribute.StringAttribute("address_1");
    public static final Attribute.StringAttribute address_2 = new Attribute.StringAttribute("address_2");
    public static final Attribute.StringAttribute city = new Attribute.StringAttribute("city");
    public static final Attribute.StringAttribute state = new Attribute.StringAttribute("state");
    public static final Attribute.StringAttribute country = new Attribute.StringAttribute("country");
    public static final Attribute.StringAttribute zip = new Attribute.StringAttribute("zip");

    public static final Attribute.StringAttribute preview_text = new Attribute.StringAttribute("preview_text");
    public static final Attribute.IntegerAttribute status_type = new Attribute.IntegerAttribute("status_type");
    public static final Attribute.StringAttribute status_name = new Attribute.StringAttribute("status_name");


    public static final Relationship<Resource, Address> resource_project = new Relationship.Builder<>(Resource.class, Address.class)
            .setRelationshipId(Address.RL_ADDRESS__RESOURCE)
            .setRelationshipName("Resource-Address")
            .setLeftClass(Resource.class)
            .setLeftMinCount(0)
            .setLeftMaxCount(1)
            .setRightClass(Address.class)
            .setRightMinCount(0)
            .setRightMaxCount(null)
            .setAllowDuplicate(false)
            .build();

}
